﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace _26右键菜单
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += MainWindow_Loaded;
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            
        }

        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = sender as MenuItem;
            int tag = Convert.ToInt32(menuItem.Tag);
            switch(tag)
            {
                case 0: {
                        tbTime1.ForceCursor= true;
                    } break;
                default: { }break;
            }
        }

        private void Mygrid_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {
            //用于禁止鼠标右键弹起引发的事件
            //if (sender != e.Source)
            //{
            //    e.Handled = true;
            //}
        }
    }
}
